#pragma once
#include <vector>
#include <memory>
#include <string>
#include <future>
#include <opencv2/opencv.hpp>

#include "alpha_pose_define.h"
_ALPHA_POSE_NAMESPACE_BEGINE
struct PoseKeypoint
{
    float coords[2] = {0.0f};
    float score = 0.0f;
};
struct MatWithBox
{
    cv::Mat mat;
    cv::Rect box;
};

using PoseKeypointsArray = std::vector<PoseKeypoint>;

class __declspec(dllexport) Infer
{
public:
    virtual std::shared_future<PoseKeypointsArray> commit(const MatWithBox &image) = 0;
    virtual std::vector<std::shared_future<PoseKeypointsArray>> commits(const std::vector<MatWithBox> &images) = 0;
};

std::shared_ptr<Infer> __declspec(dllexport) create_infer(
    const std::string &engine_file,
    int gpuid,
    float confidence_threshold = 0.25f,
    bool use_multi_preprocess_stream = false);

_ALPHA_POSE_NAMESPACE_END
